const baseURL = process.env.VUE_APP_BASE_API

// 通用下载方法

export function exports(fileName, uuid) {
  window.location.href = baseURL + '/file/download?fileName=' + fileName + '&uuid=' + uuid
}

// 下载代码zip包的地址
export function downloadGeneratorZip() {
  console.log(baseURL + '/generator/download')
  window.location.href = baseURL + '/generator/download'
  console.log(baseURL + '/generator/download')
}

// 性别格式化
export function sexFormat(sex) {
  if (sex === 1) {
    return '男'
  } else {
    return '女'
  }
}

// 自定义表头
export function hasTable(col, columns) {
  // col 当前表头，columns所有的表头
  let aa = true
  columns.forEach(item => {
    if (item.value === col) {
      aa = item.visible
    }
  })
  return aa
}
